<template>
  <swiper v-if="banners.length" :options="swiperOption" class="swiper_container">
    <swiper-slide v-for="(item, index) in banners" :key="index">
      <img :src="item.image" alt="">
      </swiper-slide>    
    <div class="swiper-pagination" slot="pagination"></div>
  </swiper>
</template>

<script>
import "swiper/dist/css/swiper.css";
import { swiper, swiperSlide } from "vue-awesome-swiper";
export default {
  components: {
    swiper,
    swiperSlide
  },
  props: {
    banners: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    return {
      swiperOption: {
        loop: true,
        pagination: {
          el: ".swiper-pagination"
        },
        autoplay: {
          delay: 2500,
          disableOnInteraction: false
        },
      }
    };
  }
};
</script>

<style scoped>
  img {
    width: 100%;
  }
</style>